package cn.tedu._04weibo.base.response;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class jsonresulte
{
    private Integer state;
    private String message;
    private Object data;
    public jsonresulte (statuscode statuscode, Object  data)
        {
            this.state = statuscode.getState();
            this.message = statuscode.getMessage();
            this.data=data;
        }
    public jsonresulte(statuscode statuscode)
    {
        this.state = statuscode.getState();
        this.message = statuscode.getMessage();
        this.data =null;
    }

    public static jsonresulte success()
    {
        return new jsonresulte(statuscode.SUCCESS);
    }
    public static jsonresulte success(Object data)
    {return new jsonresulte(statuscode.SUCCESS, data);}
}
